<?php
/**
 * Created by Shijie Liu. 2017/6/18
 * 是否登陆判断，用于验证cookies
 */
    include("DB_util.php");
    $db = new DB_util();
    $uid = $_COOKIE["user_login"];

    if(isset($uid)){
        $sql_name = "SELECT user_name From user WHERE user_id = $uid;";
        $result = $db->queryDB($sql_name);
        $name = $result->fetch_row()[0];
        echo $name;
    }else{
        echo 0;  //未登录设置为none
    }